function TryLaterLogOut() {
    jQuery.ajax({ 
    	url: 'registration',
        data: "action=LogOut",
        timeout: 2000, 
        error: function() {
          console.log('Failed to send ajax');
          }, 
        success: function() { 
        	window.location = 'index.jsp';
   }});
}

function JoinTeam()
{
    jQuery.ajax({ 
        data: "action=JoinTeam&TeamToJoinId="+$('#SelectJoinTeam option:selected').val(), 
        url: 'servletMainPage', 
        timeout: 2000, 
        error: function() {
          console.log('Failed to send ajax');
          }, 
        success: function() { 
        	changeDivMainContainer();
   }});
}

function changeDivMainContainer(){
    $('#DivMainContainer').fadeOut("medium",function(){ 
        $('#DivMainContainer').empty(); 
        $('#DivMainContainer').append("<p id='requestSend'>Request sent.<button class='yellowButton largeBtn' onClick='TryLaterLogOut()'>Return to Main Page</button>").fadeIn("medium");});                     
 }